package com.deyang.workflow.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.deyang.workflow.entity.WorkOrderDetails;
import com.deyang.workflow.entity.WorkOrderTemplateLog;
import com.deyang.workflow.mapper.WorkOrderTemplateLogMapper;
import com.deyang.workflow.service.IWorkOrderTemplateLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 模板表记录表 服务实现类
 * </p>
 *
 * @author zhanghuaiyu
 * @since 2021-07-01
 */
@Service
public class WorkOrderTemplateLogServiceImpl extends ServiceImpl<WorkOrderTemplateLogMapper, WorkOrderTemplateLog> implements IWorkOrderTemplateLogService {

    @Autowired
    private WorkOrderTemplateLogMapper workOrderTemplateLogMapper;

    @Override
    public List<WorkOrderTemplateLog> queryTemplateLog(String templateCode) {

        //根据模板id查询对应的模板修改记录
        QueryWrapper<WorkOrderTemplateLog> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("template_code", templateCode);
        List<WorkOrderTemplateLog> workOrderTemplateLogs = workOrderTemplateLogMapper.selectList(queryWrapper);
        return workOrderTemplateLogs;
    }
}
